package main

import "fmt"

func main() {
	//this is primary example
	if 9%2 == 0 {
		fmt.Println("9 is even")
	} else {
		//odd奇数
		fmt.Println("9 is odd")
	}

	//可以不需要else
	if 9%3 == 0 {
		fmt.Println("9 is divisible by 3")
	}

	//在条件语句之前可以有一个声明语句；在这里声明的变量可以在所有的条件分支中使用
	if num := 6; num < 0 {
		fmt.Println(num, "is negative")
	} else if num < 9 {
		fmt.Println(num, "is has one digit")
	} else {
		fmt.Println(num, "has many digit")
	}
}
